function callUserCheckSubDomain()
{
    var pars = "module=POBMember&func=checksubdomain&name="+Form.getElements("prop_domainname");
    var myAjax = new Ajax.Request(
        document.location.pnbaseURL + "ajax.php",
        {
            method: 'post',
            parameters: pars,
            onComplete: checksubdomain_response
        });
}


function checksubdomain_response(req){
    if(req.status != 200 ) {
        pnshowajaxerror(req.responseText);
        return;
    }
    var json = pndejsonize(req.responseText);

    pnupdateauthids(json.authid);
    $('newuserauthid').value = json.authid;

    var result     = json.result;
    var errorcode  = json.errorcode;
    var formfields = Form.getElements("newuser");
    // Resetting before going further
    for (var i = 0; i < formfields.length; i++) {
        Element.removeClassName(formfields[i], 'errorrequired');
    }
    Element.removeClassName('users_agreetoterms', 'errorrequired');

    showerrortext(errorcode, result);
    if(errorcode == 1) {
        $('submitnewuser').disabled = !$('submitnewuser').disabled;
    } else {
        switch(errorcode) {
            case 2:
              Element.addClassName('users_email', 'errorrequired');
              break;
            case 3:
              Element.addClassName('users_agreetoterms', 'errorrequired');
              break;
            case 4:
              Element.addClassName('users_uname', 'errorrequired');
              break;
            case 5:
              Element.addClassName('users_uname', 'errorrequired');
              break;
            case 6:
              Element.addClassName('users_uname', 'errorrequired');
              break;
            case 7:
              Element.addClassName('users_uname', 'errorrequired');
              break;
            case 8:
              Element.addClassName('users_uname', 'errorrequired');
              break;
            case 9:
              Element.addClassName('users_email', 'errorrequired');
              break;
            case 10:
              Element.addClassName('users_email', 'errorrequired');
              Element.addClassName('users_vemail', 'errorrequired');
              break;
            case 11:
              break;
            case 12:
              Element.addClassName('users_email', 'errorrequired');
              break;
            case 14:
              Element.addClassName('users_reg_answer', 'errorrequired');
              break;
            case 15:
              Element.addClassName('users_pass', 'errorrequired');
              break;
            case 16:
              Element.addClassName('users_pass', 'errorrequired');
              Element.addClassName('users_vpass', 'errorrequired');
              break;
            case 17:
              Element.addClassName('users_pass', 'errorrequired');
              break;
            case 25:
              var fields = json.fields;
              for(var i = 0; i < fields.length; i++) {
                  //var field = document.getElementById(fields[i]);
                  Element.addClassName('prop' + fields[i].toLowerCase(), 'errorrequired');
              }
              break;
            default:
              for (var i = 0; i < formfields.length; i++) {
                  Element.removeClassName(formfields[i], 'errorrequired');
              }
              $('submitnewuser').disabled = true;
              break;
        }
    }
}